import { createStore } from "vuex";

export default createStore({
  // 全局的响应式变量
  state: {
    token: "",
    UID: "00",
  },
  // state: () => {
  //   return {
  //     token: "xxxx",
  //     UID: "00",
  //   };
  // },
  getters: {
    tokenEx: (state) => {
      return "Bearer " + state.token;
    },
  },
  mutations: {
    setToken(state: any, payload) {
      state.token = payload;
    },
    other(){

    }

    // store.flushToken("xxxxx")
    // store.commit("flushToken","xxxxx")
  },
  actions: {},
  modules: {},
});
